﻿using Curry.Forum.Command.Handler.AutoFac;
using Curry.Forum.Command.Handler.Command;
using Curry.Forum.Facade;
using Curry.Forum.Facade.Core.Request;
using Curry.Forum.Query.Command;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Curry.Forum.Command.Handler.CommandHandler
{
    public class ArticleHandler
    {
        public void CreateArticleModel(string message)
        {
            AutofacExt.GetFromFac<ArticleCommandApp>().CreateArticleModel(message);
        }

        public BasicResponse GetAllArticle(int pageIndex, int pageSize)
        {
            return AutofacExt.GetFromFac<ArticleCommand>().GetAllArticle(pageIndex, pageSize);
        }

        public BasicResponse GetArticleById(string Id)
        {
            return AutofacExt.GetFromFac<ArticleCommand>().GetArticleById(Id);
        }

        public bool Create(ArticleInfoRq article)
        {
            return AutofacExt.GetFromFac<ArticleCommandApp>().Create(article);
        }

        public bool DeleteArticle()
        {
            return false;
        }
    }
}
